<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>添加新角色</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery1.9.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/xcConfirm.css"/>
<script src="${pageContext.request.contextPath }/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jQuery-jcDate.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/jcDate.css" media="all" />
<script type="text/javascript">
	$(document).ready(function(){
		//addEmp();
		$("input.jcDate").jcDate({					       
			IcoClass : "jcDateIco",
			Event : "click",
			Speed : 100,
			Left : 0,
			Top : 28,
			format : "-",
			Timeout : 100
        });
	});

	function addCarInfo(){
			$.ajax({
				url:'addCarInfoAction.action',//请求的远程url
				data:$("#actionForm").serialize(),//发送到服务器的数据
				type:"POST",//默认值: "GET")。请求方式 ("POST" 或 "GET")
				dataType:"json",//服务器返回的数据类型，有几种返回类型：xml,html,script,json,text(默认)
				success:function(data){
					var jsonMap = eval("(" + data + ")");
					var res = jsonMap.res;
					var error  = jsonMap.error;
					if(res == true){
	   					var txt=  "添加成功";
						window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.success);
	   				}else{
	   					var txt=  "添加失败,"+error;
						window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
	   				}
				}
			});
	}
</script>
<style type="text/css">
  td{text-align: center;height:35px; }
  .css-a{text-decoration: none;color: #FFFFFF}
  .label-class{background-image:url(${pageContext.request.contextPath }/img/chacunclick.png) }
</style>
</head>
<body>
    <div>
       <form id="actionForm" method="post">
          <div>
               <table width="100%">
                  
                  <tr>
                      <td width="80%"></td>
                      <td width="10%"  class="label-class"><label onclick="addCarInfo()"><a href="#" class="css-a">添加</a></label></td>
                      <td width="10%" class="label-class"><label><a href="carQuery.jsp" class="css-a">返回</a></label></td>
                  </tr>
               </table>
          </div>
          <div>
               <table width="100%">
                  <tr>
                     <td><label>所属仓库:</label></td>
                     <td>
                        <select name="warehouseid">
			              <option class="opt" value="">请选择仓库...</option>
	                      <c:forEach var="wareInfo" items="${sessionScope.warehouseList }">
	                          <option class="opt" value="${wareInfo.warehouseid }">${wareInfo.address }</option>
	                      </c:forEach>
		                </select>
                     </td>
                     <td><label>车牌号:</label></td>
                     <td><input type="text" name="licenseno" placeholder="请输入车牌号......" /></td>
                  </tr>
                  <tr>
                     <td><label>车型:</label></td>
                     <td>
                        <select name="cardmodel">
                          <option value="">请选择车型...</option>
                          <option value="箱式货车">箱式货车</option>
                          <option value="仓栅式货车">仓栅式货车</option>
                          <option value="仓栅式货车">集装箱货车</option>
                          <option value="仓栅式货车">平板式式货车</option>
                        </select>
                     </td>
                     
                     <td><label>运输类型:</label></td>
                     <td>
                        <select name="transtype">
                          <option value="">请选择运输类型...</option>
                          <option value="长途">长途</option>
                          <option value="短途">短途</option>
                        </select>
                     </td>
                  </tr>
                  
                  <tr>
                     <td><label>购买日期:</label></td>
                     <td><input  class="jcDate " style="width:200px; height:20px; line-height:20px; padding:4px;" type="text" name="purchasedate" placeholder="请选择购买日期......" /></td>
                  </tr>
               </table>
          </div>
       </form>
    </div>
</body>
</html>